<?php

namespace Modules\WeChat\Http\Controllers;

use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Request;
use Modules\WeChat\Service\GoodsOrderService;

class GoodsOrderController extends Controller
{
    /**
     * 积分商城订单列表
     */
    public function getGoodsOrderList()
    {
        try {
            $arr_input = Request::input();
            $arr_admin_user = wechat_user();
            $n_shop_id = intval($arr_admin_user['shop']['id']);

            return GoodsOrderService::getGoodsOrderList($n_shop_id, hi_array_del_null($arr_input));
        } catch (\Exception $exception) {
            return hello_error('失败', [], $exception->getMessage());
        }
    }

    /**
     * 积分商城订单详情
     */
    public function getGoodsOrderDetail()
    {
        try {
            $arr_input = Request::input();
            $arr_admin_user = wechat_user();
            $n_shop_id = intval($arr_admin_user['shop']['id']);

            return GoodsOrderService::getGoodsOrderDetail($n_shop_id, hi_array_del_null($arr_input));
        } catch (\Exception $exception) {
            return hello_error('失败', [], $exception->getMessage());
        }
    }

    /**
     * 门店服务商品订单列表
     */
    public function getRepairOrderDist()
    {
        try {
            $arr_input = Request::input();
            $arr_admin_user = wechat_user();
            $n_shop_id = intval($arr_admin_user['shop']['id']);

            return GoodsOrderService::getRepairOrderDist($n_shop_id, hi_array_del_null($arr_input));
        } catch (\Exception $exception) {
            return hello_error('失败', [], $exception->getMessage());
        }
    }
}
